package xjvm_v1.instruction.math.arithmetic;


import xjvm_v1.instruction.Instruction;
import xjvm_v1.interp.BytecodeReader;
import xjvm_v1.interp.CallSite;
import xjvm_v1.interp.Interpreter;
import xjvm_v1.runtime.*;

public class Isub implements Instruction {

    @Override
    public void execute(RunTimeEnv runTimeEnv, JThread jThread, MyClass javaClass,
                        CallSite callSite, Interpreter interpreter, BytecodeReader code) {
        JavaFrame javaFrame = jThread.getTopFrame();
        OperandStack operandStack = javaFrame.operandStack;

        int var1 = operandStack.popInt();
        int var0 = operandStack.popInt();
        int subValue = var0 - var1;
        operandStack.putInt(subValue);
    }
}
